<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>学生管理</title>
	<%@ include file="/pages/common/head_base.jsp"%>

	<script type="text/javascript">
		$(function () {
			$("a.deleteClass").click(function () {
				/**
				 * confirm("提示信息")是一个确认提示按钮
				 * 参数是提示信息
				 * 有两个按钮：确认和取消
				 * 返回true表示确认，返回false表示取消
				 */
				return confirm("你确定要删除学号为" + $(this).parent().parent().find("td:first").text() + "的学生吗?");
			})
		})
	</script>

</head>
<body>
	
	<div id="header">
			<span class="wel_word">学生管理</span>
		<%@ include file="/pages/common/manager_menu.jsp"%>
	</div>
	
	<div id="main">

		<table>

			<tr>
				<td>学号</td>
				<td>姓名</td>
				<td>班号</td>
				<td>性别</td>
				<td>年龄</td>
				<td>手机号</td>
				<td colspan="2">操作</td>
			</tr>

			<c:forEach items="${requestScope.studentList}" var="student">
				<tr>
					<td>${student.sno}</td>
					<td>${student.sname}</td>
					<td>${student.classno}</td>
					<td>${student.ssex}</td>
					<td>${student.sage}</td>
					<td>${student.sphone}</td>
					<td><a href="studentServlet?action=findStudent&sno=${student.sno}">修改</a></td>
					<td><a class="deleteClass" href="studentServlet?action=deleteStudent&sno=${student.sno}">删除</a></td>
				</tr>
			</c:forEach>

			<tr>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td><a href="special_situationServlet?action=findAll">特殊情况汇总</a></td>
				<td><a href="pages/manager/student_edit.jsp">添加学生</a></td>
				<td><a href="studentServlet?action=exportXLS">导出报表</a></td>
			</tr>
		</table>
	</div>
	<%@ include file="/pages/common/footer.jsp"%>
</body>
</html>